<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<%@ page import="org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter" %>
<%@ page import="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter" %>
<%@ page import="org.springframework.security.web.WebAttributes" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="g" uri="http://geni-max.com/tags"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script type="text/javascript">
testSelect = function(event,formName) {
	var objForm = document[formName];
	var objCode = document[formName]["salesOrderSO.customerCode"];
	var objName = document[formName]["salesOrderSO.customerName"];
	var objId = document[formName]["salesOrderSO.customerId"]; 	
	
	Geni.Popup.showWindow(
	{
		url:				customerUrl,
		title:				customerTitle,
		width:				500,
		height:				300,
		returnCallback:		function(iReturnValue) {
			if ( iReturnValue != null ) {
			objName.value=iReturnValue.name;
			}
		}
	});
	
	return false;
};

function selectMerge(id) {
	  if(isNaN(id)){
	    alert('请选择要合并的定单');
	    return ;
	  }
	  alert("Ok");
	  Geni.Popup.showWindow({
	      url: "<g:url namespace='/module/order' action='ListSoPreMerge' includeParams='none'/>?salesOrderId=" + id,
	      title: "合并货物",
	      width: 800,
	      height: 500,
	      returnCallback: function(data) {
	     	// var dispatchUrl = "<g:url namespace='/module/order' action='ListSoSplited' includeParams='none' />";
	    	// window.parent.location = dispatchUrl ;
	    	window.location.reload();
			console.log("parent");
	        if (data != null) {
	        }
	      }//$j('.id').val()
	  });
}
</script>
<body>
数据字典

<g:form id="queryForm" namespace="/module/order" validate="false" name="formObject" action="ListSoSplited" cssStyle="margin:0px">
  <g:panel >
		<g:grid cols="6" cssStyle="width:80%">
			<g:fieldgroup key="label.customer.name" >
				<g:autocompleter name="salesOrderSO.customerName" id="cName" cssStyle="width:135px;" listUrl="SearchCustomerName.bl" listWidth="200" listHeight="120"/>
				<g:popup onclick="return testSelect(event,'formObject');" />
			</g:fieldgroup>				
			<g:fieldgroup key="so.soTime" inputcolspan="3">
				<g:label value="%{getText('so.from')}" />
				<g:datepicker name="salesOrderSO.fromDate" showsTime="true" cssStyle="width:120px;"/>
				<g:label value="%{getText('so.to')}"/>
				<g:datepicker name="salesOrderSO.toDate"  showsTime="true" cssStyle="width:120px;"/>
			</g:fieldgroup>				
		</g:grid>			
		
	    <g:toolbar>
          <g:button type="submit" key="query" cssClass="button" />
          <g:button type="submit" key="button.clearQuery" onclick="commonClearQuery()" cssClass="button"/>
        </g:toolbar>
  </g:panel>

</g:form>

<g:toolbar>
	<g:button type="submit" key="button.merge" cssClass="button" onclick="selectMerge($j('input[@name=id][@checked]').val());"/>
</g:toolbar>


<g:panel>
  <g:tabbedContainer refurbish="true" href="ListBillToParty.bl?customerId=%{customerId}">
  	<g:tabbedPanel id="flow1" key="billToParty_info" href="ListBillToParty.bl?customerId=%{customerId}">
  		<tiles:insertTemplate template="billToPartyList.jsp" />
  	</g:tabbedPanel>
  	<g:tabbedPanel id="flow3" key="associatedparty_biz" href="ListAssociatedParty.bl?customerId=%{customerId}&&associatedPartyType=BIZASSOCIATED">
  		<tiles:insertTemplate template="associatedPartyBizList.jsp" />
  	</g:tabbedPanel>
  	<g:tabbedPanel id="flow4" key="customer_sender" href="ListLogicAddressGroupSender.bl?customerId=%{customerId}&type=SENDER">
  		<tiles:insertTemplate template="logicAddressGroupListSender.jsp" />
  	</g:tabbedPanel>
  	<g:tabbedPanel id="flow5" key="customer_receiver" href="ListLogicAddressGroupReceiver.bl?customerId=%{customerId}&type=RECEIVER">
  		<tiles:insertTemplate template="logicAddressGroupListReceiver.jsp" />
  	</g:tabbedPanel>
  	<g:tabbedPanel id="flow6" key="customer_profile" href="PreUpdateCustomerProfile.bl?customerId=%{customerId}">
  		<tiles:insertTemplate template="customerProfile.jsp" />
  	</g:tabbedPanel>
  	<g:tabbedPanel id="flow7" key="common_use_carriers" href="CommonUseCarriers.bl?customerId=%{customerId}">
  		<tiles:insertTemplate template="commonUseCarriers.jsp" />
  	</g:tabbedPanel>
  </g:tabbedContainer>
</g:panel>
</body>
</html>

